import requests

from testcases.Redskins_system.Added_Editor_Redskins_Batches import add_redskins


def redskins_send_mail(nick_name):
    id = add_redskins(nick_name)
    url = "https://webapi.internal.zhcxkj.com/celebrity/celebrity/send/email/message"
    method = "post"
    json ={
        "emailTemplateId": 8,
        "sendType": 0,
        "sendEmail": "csl5222605@outlook.com",
        "brandId": 35,
        "productId": 19,
        "subject": "红人：{#红人#}，主题：NUOLUX 婚庆派对装饰气球迎宾路引立柱套装：12英寸国标2.8g哑光圆形气球",
        "emailContent": "<p>ولكو شو بتحكو 😍🔥تابعوني تحت🥣👇👇✨✨ℹ️✨ 11ℹ️ NUOLUX 婚庆派对装饰气球迎宾路引立柱套装：12英寸国标2.8g哑光圆形气球（粉色17个）+10英寸国标2.2g哑光圆形气球（白色17个）+<span style=\"color:#003ba5\">国标2g魔术气球</span>（粉色5个+白色5个）+18英寸心形玫红波👇点铝膜气球2个+气球卡扣8个+水晶打气筒1个（颜色随机）+环保加厚水晶杆子8个+底座23厘米（白色2个）🐍T🐍ℹ️💡🧐💌</p><div class=\"media-wrap image-wrap\"><img class=\"media-wrap image-wrap\" src=\"https://zhcxkj-java-test.obs.cn-south-1.myhuaweicloud.com/celebrity/email/sent/334adcc76f1344918fbbc787e80e35e4.png\"/></div><p></p>",
        "celebrityIds": [
            id
        ]
    }

    headers = {
        "Accept": "application/json",
        "Authorization_V2": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJyYW5kb21udW1iZXIiOiI2Yjg1OTE1OS1kZWRkLTRhMGMtYWM3Yi05M2E1ZWVlMjEyODYiLCJ1c2VyX2lkIjoxNjE4NiwidXNlcl9rZXkiOiJlYTdkYjgyYjM5M2UzNjBiMjAzNzlhYWIzYTUxZTQ5MCIsInVzZXJuYW1lIjoi5aSP5a6HIn0.XaWC-P6x_Q0UWpuSvaNAx5vzlzhXN5uAfBjhZaX4I2p2psXN88MqoNEOFsgouPvLuAm8veLbFga6BLw4fDSwZA",
        "Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
        "Accept-Encoding": "gzip, deflate, br",
        "Content-Type": "application/json;charset=UTF-8",
        "X-Requested-With": "XMLHttpRequest",
        "Connection": "keep-alive",
        "TE": "trailers",
        "Authorization": "Basic emhjeGphdmE6MTIzNDU2",
    }

    response = requests.request(method=method, url=url, json=json, headers=headers)
    # print(response.json())
    return response.json()


if __name__ == '__main__':
       res = redskins_send_mail("夏宇测试01")
       print(res)

